Skip to content

fix: preserve tray caption fonts during repeated style assignments - #239

Merged
lumenpearson merged 2 commits into
dev/resw-localizationfrom
dev/tray-font-lifetime
Nov 13, 2026
Merged

lumenpearson merged 2 commits into
dev/resw-localizationfrom
dev/tray-font-lifetime

Conversation

@lumenpearson

@lumenpearson lumenpearson commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

The tray menu assigns Bold = false to a caption whose designer font is already regular. The old setter creates an equal Font, assigns it and disposes the previous instance. WinForms can retain the previous instance when the values are equal, so the selected caption font becomes unusable. Installed RESW reservation265 exposed an unreadable Exit label and stopped before case2.

Changes

  • Keep the selected caption font when its style already matches the requested Bold value. Retain the existing style-change, caption, glyph and click paths.
  • Add a Windows-only regression project that references the real tray control. Ten literal EN/RU cases measure and draw the selected font on an STA thread, including two positive controls with unequal style changes.
  • Run these tests in the Windows CI library job and include the project in the package audit. Document the Windows command and exact evidence/provenance.

This is a narrow stacked PR into dev/resw-localization / PR #237. The original presentation, localization and JSON beta evidence remains preserved.

Verification

Final source HEAD: cd5bcfd9a059f287b9cc851fb5a33845280c3cbe.

The local GREEN run used base 541d32fd135f72861ad2ded001a5e50bf48d07f2 and exact frozen patch 69a6415241ff4a7bea8cbf344d24d511d868b10e54275920466a9f1a238bef53 before committing corrective product code. All tested source, test and CI files match this final HEAD; only the plan's evidence prose/check boxes changed after execution.

Executed check Actual result
Original full managed baseline 2600 passed; 0 failed or skipped.
Real-control RED Eight assertion failures at Font.GetHeight; two unequal-style positive controls passed; no compile/restore failure counted as RED.
Corrected Windows font suite 10 passed; 0 failed or skipped.
Complete candidate managed suite 2600 passed; 0 failed or skipped.
Normal tray Release/x64 build Exit0; 0 warnings and 0 errors.
Governance and branch whitespace 171 Markdown files checked; 0 governance errors; diff check passed.

Actual loaded framework: .NET8.0.33, Windows Forms and System.Drawing.Common file8.0.3326.52211 from the task-local WindowsDesktop runtime. The NuGetDrawing8.0.31 preparation pin was not the actual Font assembly selected by the test host; its role is recorded separately.

RED TRX SHA256: 9fd9ccbd5a9f96fd764b56b428bbdfc5433f64dfd041d98b1fc99a243227cb42. GREEN TRX: b0c698c4f7000dded1a468eb70b170eb8cd2ea03f33b5809ba7b5a48ef96e1e6. Candidate managed TRX: bd84fdb856fc6bb2ac4db51b973338d7b69a499457360992785f6b4cd0300d55.

Both serial reservations269/271 were qualified and released as270/272 after fresh absence checks. Original results, process identities and used compiled files are retained. The plan and evidence record gives exact limits.

Independent whole-change source and retained-evidence review passed on this final HEAD with no Critical, Important or Minor findings. Reviewer /root/tray_font_final_review independently verified all 108 RED and 54 GREEN retained files, parsed the TRX results and verified the 1,614-input bridge (only later plan prose differs). Receipt SHA256: f2fe362eaa591a321f5044ed77f7edaf938648c86c416d66058a8b1a67da4220. Final committed-HEAD CI is complete: all nine latest check names and Contribution metadata succeeded. PUSH CI43476971367 and PR CI43477146319 both passed; the hosted library log records2600+10 passed, zero failures or skips. File scanning and the PR two-new-commit history scan are clean; the new-branch PUSH history scan was skipped, which is explicitly excluded from history proof. The exact selected CI MSI completed native reservation275: all16 original installed RESW scenarios passed independent retained review. Readable EN/RU Tray captions and normal Quit are verified. Main integration remains a separate gate.

Risk and recovery

Low risk for a private caption-font lifetime correction. Repeated assignments must keep a usable font while genuine style changes retain their appearance and command behavior. The regression cases exercise actual font use rather than only cached Style/Equals values.

Recover additively in the owned branch using the recorded previous source and retained binaries. Preserve all stopped native265 evidence and frozen original refs. The private bitmap result does not prove the exact caught paint exception in265 or its historical runtime baseline.

Related work

Refs #238. Parent stable RESW work: #236 / PR #237. Subsequent presentation integration: #234. Broader installed GUI/tray scope: #16. Main-stage acceptance and broader active-branch adoption remain separate.

Maintainer checks

  • Link an open owning task with the complete contract in docs/task-lifecycle.md.
  • Read back actual issue and Project fields; body classification alone is insufficient. Issue238 item304164716: In progress / P1 / UX / Low, confirmed in267 and independently read back.
  • Set exactly one type: label and at least one area: label.
  • Set an assignee and the owning G1–G5 milestone.
  • Add the PR to the delivery Project. Actual item304223837: In progress / P1 / UX / Low, table and board reload verified in273, independently rehashed/read by Root and released274.
  • Record dependencies and the previous status for blocked work. Installed RESW16 is accepted for the exact cd5 package; reviewed main integration remains the parent gate.
  • Complete independent review and resolve review conversations. Fresh authorized reviewer reports no findings; this is agent evidence review, not a fabricated human approval.
  • Verify required checks on the final HEAD. Final-HEAD CI is successful; native275 independently accepted readable EN/RU Tray captions, normal Quit and the sampled process-continuity pairs.
  • Update EN/RU instructions when behavior changes. The command is documented in both contribution guides; release acceptance remains with the parent release scope.

All PR-local checks are verified. Issue #238 remains open for normal integration, final main tree/post-checks and its six-section acceptance record. No main integration or issue closure is claimed here.

The distinct evidence/bridge/CI/package review also passed (receiptsC65941F9 and8074760C). Selected PUSH artifact14062464409: ZIP SHA256122411CAA6168D7457BF03E24F8CA12C49535332332B449CDABD70075C9BB47F, contained MSI SHA256E5B9E8BD463B4DCE97B59D7040676CE846A9FB4C43E8DEB09A5D98C145578BB6. This exact MSI was installed only in a fresh offline Sandbox under275. Whole retained review accepted16/16 after qualified release276. Old265 remains stopped and preserved.

Installed native acceptance

Reservation275 used source cd5bcfd9a059f287b9cc851fb5a33845280c3cbe, WindowsDesktop8.0.33 and the pinned MSI above. All16 original ordered scenarios executed once, with68 unique bound commands and no replay. EN/RU Tray Exit captions and relevant regular/bold captions are readable; actual semantic Quit and bound process inspections return zero. Four before/after pairs preserve sampled PID/creation time/path/parent. This establishes sampled continuity, not continuous ancestry or live Tray language refresh.

The independent reviewer inspected all61 unique permitted original frame contents and rehashed the355-file/4-external-receipt retained manifest 520B5EF7B6DE2D505CFB22C7E760FFED885A231069C052FF6DB79E7AF435B20E. Whole16 acceptance receipt: EAC00D398998A3BEA99E1081B87FABBF85A95408D4B9CE08FE45D802D8D0DE04; separate data validation: 5870C2D0B3DA950D3E6A1A23729360F71A86E96DA6922999DDC311086C3C45E7. This is retrospective independent agent evidence review, without an invented human approval or click witness.

Initial/final322 payload files and14 guest inputs match. Host833 files,16 registry roots, primary index and protected foreign VM identity are preserved. Normal Sandbox disposal and monitor normally-finished plus fresh owned identity/descendant absence qualified release276 1427E60AE6DAEAA8F97D621F52F75298A8F5AEE0B9CEAD0044609AC4D231726E. The monitor raw OS exit code was not measured. The frozen active resource receipt is validated against its immutable archived version and subsequent release transition.

Cases8/12/13 use unchanged Windows ru-RU fallback when the preference cannot be read; English emergency UI in that combined-failure state is not claimed. No criterion or sealed input changed, no formal STOP was waived, and no case replay occurred. Native265, earlier failed attempts and historical black-screen evidence remain preserved; the old black-screen cause remains unknown. Broader G3/G4/G5, main integration, active-branch adoption and #234 are separate gates.

The RESW execution owner freshly confirmed clean local/remote base ffae24346fa80ed5a6fc4a5e2ae1de9c000aee21 and the safe normal-merge boundary (ACK EFB7F06F9E118A96930333F0F0C8CC49010D93EECF761A161E875E47E3A67B28). Keep both owned worktrees, all frozen refs and foreign WIP.

The change adds a Windows-only xUnit project for the actual `ModernButtonUserControl`. The project targets .NET 8, enables Windows Forms, restricts builds to x64, and references the tray project.

The regression theory covers English and Russian captions across equal, repeated, and changed `Bold` assignments. The test creates the control on an STA thread without a visible window or tray entry point. The assertions verify the public state, label text, requested font style, and completion within 15 seconds.

The drawing check exercises the selected native-backed font through `GetHeight` and `DrawString`. The bitmap scan confirms that rendering changes pixels from the black background. The diagnostic output records framework, Windows Forms, drawing, and tray assembly identities. The assembly setting disables parallel test execution.

The implementation plan records the reproduction, correction, verification, native acceptance, and integration stages. The document keeps execution and acceptance checks pending, and identifies the font disposal mechanism as an unconfirmed hypothesis.

Changed files:

- "CDPIUI.TrayIcon.Tests/CDPIUI.TrayIcon.Tests.csproj" (+20/-0 lines).
- "CDPIUI.TrayIcon.Tests/ModernButtonFontLifetimeTests.cs" (+95/-0 lines).
- "docs/superpowers/plans/2026-11-13-tray-font-lifetime.md" (+60/-0 lines).

The file counts compare the staged tree with its first parent.

Staged-Tree: 859b3fa
The `Bold` setter now compares the selected font style with the requested style before replacing the font. The equal-style path retains the existing `Font` instance and avoids disposing the instance preserved by the Windows Forms setter. Genuine style changes continue to create a replacement font and dispose the previous font.

The Windows CI job now runs the tray font regression project after the existing managed suite. The script stops immediately when the managed suite fails. The package audit now includes the tray test project with the x64 platform setting.

The English and Russian contributor guides document the Windows-only tray font test command. The governance inventory records the font-lifetime plan and its provenance.

The plan marks completed regression, correction, and local verification tasks. The document records eight real-control RED failures, two positive controls, and subsequent local GREEN results. The document also preserves runtime identities, artifact hashes, and explicit acceptance boundaries. Final committed-HEAD, native tray, RESW16, installer provenance, and integration checks remain pending.

Changed files:

- ".github/CONTRIBUTING.md" (+1/-0 lines).
- ".github/CONTRIBUTING.ru.md" (+1/-0 lines).
- ".github/workflows/ci.yml" (+6/-2 lines).
- "CDPIUI.TrayIcon/Controls/ModernButtonUserControl.cs" (+5/-1 lines).
- "docs/governance/document-inventory.json" (+10/-0 lines).
- "docs/superpowers/plans/2026-11-13-tray-font-lifetime.md" (+30/-10 lines).

The file counts compare the staged tree with its first parent.

Staged-Tree: a7da6a6
@lumenpearson lumenpearson added type:bug Fix a reproducible defect in application behavior. area:native-qa Native Windows and UI checks with revision, environment and evidence. area:ux Keyboard, focus, accessibility, scaling and user interface behavior. labels Nov 13, 2026 — with ChatGPT Codex Connector
@lumenpearson lumenpearson self-assigned this Nov 13, 2026
@lumenpearson lumenpearson moved this from Inbox to In progress in CDPI UI — Delivery & Release Gates Nov 13, 2026
@lumenpearson
lumenpearson marked this pull request as ready for review November 13, 2026 19:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T19:23:12.714891Z cd5bcfd Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lumenpearson
lumenpearson merged commit 5c280cc into dev/resw-localization Nov 13, 2026
21 of 24 checks passed
@lumenpearson lumenpearson moved this from In progress to Done in CDPI UI — Delivery & Release Gates Nov 13, 2026

Copy link
Copy Markdown
Owner Author

Final integration and closeout are accepted. This PR's normal merge5c280 preserves exact testedcd5 tree and its code is in main d21167564afbf60a0c6ad5b5f559a464c1e261f6 through PR #237. Final-head and post-main CI, full2600+10 tests, independent font/integration review and exact native275 EN/RU evidence are verified. Issue238 six-section acceptance records all6 completed criteria and material limits.

Fresh Project279 table+board readback confirms both this PR item304223837 and issue238 item304164716 are Done/P1/UX/Low with the original labels, owner and G4. Qualified release280 is 318EBD163272A2A8EC95AE86FAC747CE5DCC591C01FC9D38D30375E16556EB93; all22 proof files and original images were verified by Root, own tab closed and metadata returned. Issue238 is closed/completed. #234 native integration and broad #236 active-owner adoption remain separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:native-qa Native Windows and UI checks with revision, environment and evidence. area:ux Keyboard, focus, accessibility, scaling and user interface behavior. type:bug Fix a reproducible defect in application behavior.

Projects

Development

Successfully merging this pull request may close these issues.

1 participant